﻿using System;

// XNA lib
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;

//Oak Engine Lib
using OakEngine.GameState;
using OakEngine.Input;
using Microsoft.Xna.Framework.Input;

namespace MainJumpFleet.GameStates
{
    public partial class LevelDesignGameScreenState : OAK_IGameState
    {
        private void LoadAssets()
        {
            #region LOAD AUDIO
            // loads the background music
            backgroundMusicSong = CGame.CGame.GetInstance().Content.Load<Song>(@"backgroundMusic\beacon_of_hope_strings");
            isBackgroundMusicPaused = false;
            #endregion

            #region LOAD TEXTURES            
            starfieldBackgroundTexture = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\starfield_1024x1024");
            
            playerShipTexture = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\ship2_77x128");

            enemyShipFighterTexture = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\ship4_86x128");
            enemyShipCruiserTexture = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\ship5_118x128");
            
            asteroidTextures = new Texture2D[10];
            asteroidTextures[0] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid01_untinted_126x128");
            asteroidTextures[1] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid02_untinted_102x128");
            asteroidTextures[2] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid03_untinted_101x128");
            asteroidTextures[3] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid04_untinted_111x128");
            asteroidTextures[4] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid05_untinted_128x115");
            asteroidTextures[5] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid06_untinted_128x104");
            asteroidTextures[6] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid07_untinted_128x109");
            asteroidTextures[7] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid08_untinted_127x128");
            asteroidTextures[8] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid09_untinted_111x128");
            asteroidTextures[9] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\asteroid10_untinted_119x128");

            planetTextures = new Texture2D[1];            
            planetTextures[0] = CGame.CGame.GetInstance().Content.Load<Texture2D>(@"textures\planet12_512x512");
            #endregion

            #region LOAD SPRITE TEMPLATES
            // creates the static sprite template for the starfield background 
            spriteManager.CreateStaticSpriteTemplate("StarfieldBackground", starfieldBackgroundTexture, 0, 0, 1024, 1024, Color.White, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.TopLeft, 1.0f, SpriteEffects.None, 1.0f);

            // creates the static sprite template for the player ship
            spriteManager.CreateStaticSpriteTemplate("PlayerShip", playerShipTexture, 0, 0, 77, 128, Color.White, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.3f);

            // creates the static sprite templates for the enemy ships
            spriteManager.CreateStaticSpriteTemplate("EnemyFighter", enemyShipFighterTexture, 0, 0, 86, 128, Color.White, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.5f, SpriteEffects.None, 0.401f);
            spriteManager.CreateStaticSpriteTemplate("EnemyCruiser", enemyShipCruiserTexture, 0, 0, 118, 128, Color.White, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.5f, SpriteEffects.None, 0.405f);

            // sets the color for the asteroid
            Color asteroid1Color = new Color(184, 138, 64);

            // creates the static sprite templates for the asteroids
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid1", asteroidTextures[0], 0, 0, 126, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid2", asteroidTextures[1], 0, 0, 102, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid3", asteroidTextures[2], 0, 0, 101, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid4", asteroidTextures[3], 0, 0, 111, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid5", asteroidTextures[4], 0, 0, 128, 115, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid6", asteroidTextures[5], 0, 0, 128, 104, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid7", asteroidTextures[6], 0, 0, 128, 109, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid8", asteroidTextures[7], 0, 0, 127, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid9", asteroidTextures[8], 0, 0, 111, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("LargeAsteroid10", asteroidTextures[9], 0, 0, 119, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.5f);

            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid1", asteroidTextures[0], 0, 0, 126, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid2", asteroidTextures[1], 0, 0, 102, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid3", asteroidTextures[2], 0, 0, 101, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid4", asteroidTextures[3], 0, 0, 111, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid5", asteroidTextures[4], 0, 0, 128, 115, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid6", asteroidTextures[5], 0, 0, 128, 104, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid7", asteroidTextures[6], 0, 0, 128, 109, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid8", asteroidTextures[7], 0, 0, 127, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid9", asteroidTextures[8], 0, 0, 111, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("MediumAsteroid10", asteroidTextures[9], 0, 0, 119, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.667f, SpriteEffects.None, 0.5f);

            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid1", asteroidTextures[0], 0, 0, 126, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid2", asteroidTextures[1], 0, 0, 102, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid3", asteroidTextures[2], 0, 0, 101, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid4", asteroidTextures[3], 0, 0, 111, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid5", asteroidTextures[4], 0, 0, 128, 115, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid6", asteroidTextures[5], 0, 0, 128, 104, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid7", asteroidTextures[6], 0, 0, 128, 109, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid8", asteroidTextures[7], 0, 0, 127, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid9", asteroidTextures[8], 0, 0, 111, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);
            spriteManager.CreateStaticSpriteTemplate("SmallAsteroid10", asteroidTextures[9], 0, 0, 119, 128, asteroid1Color, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 0.333f, SpriteEffects.None, 0.5f);

            // creates the static sprite templates for the planets
            spriteManager.CreateStaticSpriteTemplate("LargePlanet1", planetTextures[0], 0, 0, 512, 512, Color.White, 255, 0, JumpFleetGameLib.xSprite.RotationAnchorPoint.Center, 1.0f, SpriteEffects.None, 0.6f);
            #endregion

            #region LOAD SECTOR MAP
            alpha1SectorMap = new JumpFleetGameLib.xMap.SectorMap.SectorMap("Alpha1", 1, 3, 1024, 1024, 4, 4);

            // sets the background layer's tag
            alpha1SectorMap.BackgroundLayers[0].Tag = "StarfieldBackground";

            // sets the asteroid object layer's tag
            alpha1SectorMap.ObjectLayers[0].Tag = "Asteroids";

            // sets the planet object layer's tag
            alpha1SectorMap.ObjectLayers[1].Tag = "Planets";

            // sets the enemy ship object layer's tag
            alpha1SectorMap.ObjectLayers[2].Tag = "EnemyShips";

            // sets up a starfield background tile to clone
            JumpFleetGameLib.xMap.SectorMap.StaticBackgroundTile starfieldBackgroundTile = new JumpFleetGameLib.xMap.SectorMap.StaticBackgroundTile(spriteManager, "StarfieldBackground", "StarfieldBackground", 1024, 1024, 1.0f);

            // fills the sector map with starfield background tiles
            for (int row = 0; row < alpha1SectorMap.BackgroundLayers[0].Tiles.GetLength(1); row++)
                for (int column = 0; column < alpha1SectorMap.BackgroundLayers[0].Tiles.GetLength(0); column++)
                {
                    alpha1SectorMap.BackgroundLayers[0].Tiles[column, row] = starfieldBackgroundTile.Clone();
                    alpha1SectorMap.BackgroundLayers[0].Tiles[column, row].Position = new Vector2(column * starfieldBackgroundTile.Width, row * starfieldBackgroundTile.Height);
                }

            // sets up the asteroids            
            // 3,1
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid1"), 0.25f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[0].CurrentMapOffset = new Vector2(3072, 300);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid2"), 0.35f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[1].CurrentMapOffset = new Vector2(3150, 350);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid3"), 0.32f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[2].CurrentMapOffset = new Vector2(3090, 375);

            // 4,2
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid4"), 0.28f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[3].CurrentMapOffset = new Vector2(3584, 1920);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid5"), 0.25f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[4].CurrentMapOffset = new Vector2(3548, 1825);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid6"), 0.38f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[5].CurrentMapOffset = new Vector2(3500, 1900);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("LargeAsteroid7"), 0.12f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[6].CurrentMapOffset = new Vector2(3675, 1825);

            // 3,4 - 4,4
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("LargeAsteroid8"), 0.17f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[7].CurrentMapOffset = new Vector2(3200, 3175);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid9"), 0.24f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[8].CurrentMapOffset = new Vector2(3075, 3250);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid10"), 0.26f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[9].CurrentMapOffset = new Vector2(3100, 3100);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid1"), 0.22f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[10].CurrentMapOffset = new Vector2(3250, 3025);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid2"), 0.34f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[11].CurrentMapOffset = new Vector2(3000, 3300);

            // 1,3 - 1,4 
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid3"), 0.38f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[12].CurrentMapOffset = new Vector2(1000, 2760);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid4"), 0.32f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[13].CurrentMapOffset = new Vector2(985, 2860);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid4"), 0.32f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[14].CurrentMapOffset = new Vector2(900, 2800);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid5"), 0.39f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[15].CurrentMapOffset = new Vector2(920, 2900);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid6"), 0.34f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[16].CurrentMapOffset = new Vector2(845, 3000);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid7"), 0.36f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[17].CurrentMapOffset = new Vector2(800, 3075);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid9"), 0.31f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[18].CurrentMapOffset = new Vector2(875, 3150);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid9"), 0.31f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[19].CurrentMapOffset = new Vector2(725, 3200);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid9"), 0.31f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[20].CurrentMapOffset = new Vector2(795, 3275);

            // 1,1 - 2,2
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid10"), 0.29f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[21].CurrentMapOffset = new Vector2(2040, 1736);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid1"), 0.23f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[22].CurrentMapOffset = new Vector2(1970, 1636);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("LargeAsteroid2"), 0.14f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[23].CurrentMapOffset = new Vector2(1920, 1936);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("LargeAsteroid3"), 0.16f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[24].CurrentMapOffset = new Vector2(1800, 1436);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("MediumAsteroid4"), 0.22f, true));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[25].CurrentMapOffset = new Vector2(1950, 1300);
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList.Add(new Asteroid.Asteroid(spriteManager.CreateNewStaticSpriteFromTemplate("SmallAsteroid5"), 0.32f, false));
            alpha1SectorMap.ObjectLayers[0].PositionableObjectList[26].CurrentMapOffset = new Vector2(1980, 1200);

            // sets up the planets
            // 1,1
            alpha1SectorMap.ObjectLayers[1].PositionableObjectList.Add(new Planet.Planet(spriteManager.CreateNewStaticSpriteFromTemplate("LargePlanet1")));
            alpha1SectorMap.ObjectLayers[1].PositionableObjectList[0].CurrentMapOffset = new Vector2(512, 512);  


            // sets up the enemy ships
            // 4,2
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), 0));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[0].CurrentMapOffset = new Vector2(3775, 1700);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), 0));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[1].CurrentMapOffset = new Vector2(3450, 1750);

            // 3,3 - 4,4
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), 0));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[2].CurrentMapOffset = new Vector2(3100, 3000);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), 0));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[3].CurrentMapOffset = new Vector2(3025, 2925);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), 0));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[4].CurrentMapOffset = new Vector2(2950, 3050);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), 0));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[5].CurrentMapOffset = new Vector2(2875, 3125);

            // 1,3 - 1,4
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(70)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[6].CurrentMapOffset = new Vector2(1075, 2900);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(70)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[7].CurrentMapOffset = new Vector2(975, 3000);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(70)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[8].CurrentMapOffset = new Vector2(900, 3325);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(70)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[9].CurrentMapOffset = new Vector2(625, 3300);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(70)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[10].CurrentMapOffset = new Vector2(675, 2950);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(70)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[11].CurrentMapOffset = new Vector2(755, 2775);

            // 1,1 - 2,2
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyCruiser"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[12].CurrentMapOffset = new Vector2(850, 650);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[13].CurrentMapOffset = new Vector2(1050, 600);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[14].CurrentMapOffset = new Vector2(950, 400);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[15].CurrentMapOffset = new Vector2(700, 100);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[16].CurrentMapOffset = new Vector2(300, 150);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[17].CurrentMapOffset = new Vector2(850, 850);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[18].CurrentMapOffset = new Vector2(525, 900);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[19].CurrentMapOffset = new Vector2(500, 1150);
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList.Add(new EnemyShip.EnemyShip(spriteManager.CreateNewStaticSpriteFromTemplate("EnemyFighter"), MathHelper.ToRadians(120)));
            alpha1SectorMap.ObjectLayers[2].PositionableObjectList[20].CurrentMapOffset = new Vector2(200, 1000);

            // sets the drawing depth for the background layer
            alpha1SectorMap.BackgroundLayers[0].Depth = 0.999f;

            // sets the background layer to visible
            alpha1SectorMap.BackgroundLayers[0].Visible = true;

            // sets the asteroid object layer's depth and visible
            alpha1SectorMap.ObjectLayers[0].Depth = 0.5f;
            alpha1SectorMap.ObjectLayers[0].Visible = true;

            // sets the planet object layer's depth and visible
            alpha1SectorMap.ObjectLayers[1].Depth = 0.6f;
            alpha1SectorMap.ObjectLayers[1].Visible = true;

            // sets the enemy ship object layer's depth and visible
            alpha1SectorMap.ObjectLayers[2].Depth = 0.4f;
            alpha1SectorMap.ObjectLayers[2].Visible = true;

            // sets the starting position for the sector map
            alpha1SectorMap.CurrentStartingDrawPosition = new Vector2(-alpha1SectorMap.WidthInPixels + CGame.CGame.GetInstance().Graphics.PreferredBackBufferWidth, 0);            
            #endregion

            #region PLAYER SHIP
            playerShip = new PlayerShip.PlayerShip(spriteManager.CreateNewStaticSpriteFromTemplate("PlayerShip"), 300.0f);            
            playerShip.CurrentPosition = new Vector2(CGame.CGame.GetInstance().Graphics.PreferredBackBufferWidth - 100, 100);            
            playerShip.RotationAngle = MathHelper.ToRadians(225);
            playerShip.Visible = true;
            playerShip.Camera = new JumpFleetGameLib.xCamera.Camera2D(CGame.CGame.GetInstance().Device.Viewport.Width, CGame.CGame.GetInstance().Device.Viewport.Height, playerShip, alpha1SectorMap);
            #endregion

            #region BACKGROUND MUSIC
            // starts playing the background music            
            MediaPlayer.Play(backgroundMusicSong);
            MediaPlayer.IsRepeating = true;
            #endregion
        }
    }
}
